package com.example.stock.controller;

import com.example.common.vo.Result;
import com.example.stock.dto.ratio.RatioReq;
import com.example.stock.dto.ratio.RatioParms;
import com.example.stock.dto.ratio.RatioRsp;
import com.example.stock.service.RatioService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import java.text.ParseException;
import java.util.ArrayList;
import java.util.List;

/**
 * @author ：Zhengyu Wang
 * @date ：Created in 2023/4/12 19:21
 * @description：盈亏比部分计算方案
 * @modified By：
 * @version: $
 */

@RestController
public class RatioController {
    @Autowired
    private RatioService ratioService;
//    @PostMapping("/getinfo")
//    public Result<List<StockEntity>> getinfo(@RequestBody StockReq stockReq) {
//        String stockid = stockReq.getStockid();
//        System.out.println(stockid);
//        List<StockEntity> stockInfo = stockService.getStockInfo(stockid);
//        return Result.success(stockInfo);
//    }

    @PostMapping("/getratio")
    public Result<List<RatioRsp>> getratio(@RequestBody RatioReq ratioReq){
        System.out.println(ratioReq.getStockId());
        List<RatioRsp> stockInfo = ratioService.getStockInfo(ratioReq);
        return Result.success(stockInfo);
    }

}
